{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/implement-queue-using-stacks\n",
    "\n",
    "\n",
    "\n",
    "Runtime: 32 ms, faster than 46.77% of Python3 online submissions for Implement Queue using Stacks.\n",
    "Memory Usage: 14.1 MB, less than 63.47% of Python3 online submissions for Implement Queue using Stacks.\n",
    "\n",
    "\n",
    "\n",
    "```python\n",
    "class MyQueue:\n",
    "\n",
    "    def __init__(self):\n",
    "        \"\"\"\n",
    "        Initialize your data structure here.\n",
    "        \"\"\"\n",
    "        self.queue = []\n",
    "        \n",
    "\n",
    "    def push(self, x: int) -> None:\n",
    "        \"\"\"\n",
    "        Push element x to the back of queue.\n",
    "        \"\"\"\n",
    "        self.queue.append(x)\n",
    "        \n",
    "\n",
    "    def pop(self) -> int:\n",
    "        \"\"\"\n",
    "        Removes the element from in front of queue and returns that element.\n",
    "        \"\"\"\n",
    "        r = self.queue[0]\n",
    "        self.queue = self.queue[1:]\n",
    "        return r\n",
    "        \n",
    "\n",
    "    def peek(self) -> int:\n",
    "        \"\"\"\n",
    "        Get the front element.\n",
    "        \"\"\"\n",
    "        return self.queue[0]\n",
    "        \n",
    "\n",
    "    def empty(self) -> bool:\n",
    "        \"\"\"\n",
    "        Returns whether the queue is empty.\n",
    "        \"\"\"\n",
    "        return len(self.queue) == 0\n",
    "```\n",
    "\n",
    "\n",
    "Spent one minute\n",
    "\n",
    "One shoot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
